home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / test / warn.g < prev   
Encoding:
Text File  |  1996-07-07  |  2.6 KB  |  110 lines  |  [TEXT/R*ch]

  1. ;;; This file should tweak all the warnings in the kernel,
  2. ;;; but not cause any fatal errors.
  3.  
  4. (game-module "not-the-file-name"
  5.   (program-version "0.0")
  6.   )
  7.  
  8. ;;; Warn about attempted modification of a constant.
  9.  
  10. (set true false)
  11.  
  12. ;;; Warn about an undefined table.
  13.  
  14. (table foo)
  15.  
  16. ;;; Warn about too long of a string.
  17.  
  18. (define str2 "
  19. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  20. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  21. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  22. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  23. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  24. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  25. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  26. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  27. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  28. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  29. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  30. ")
  31.  
  32. (print str2)
  33.  
  34. ;;; The following definitions give us some types to work with,
  35. ;;; they prevent Xconq from erroring out completely, and they
  36. ;;; prevent attempts to load a default game, which can happen
  37. ;;; as part of trying to make sense of some top-level forms.
  38.  
  39. (unit-type u1)
  40. (unit-type u2)
  41. (unit-type u3)
  42.  
  43. (terrain-type t1)
  44. (terrain-type t2)
  45.  
  46. ;;; Nonsensical top-level forms.
  47.  
  48. 12345
  49.  
  50. (burp)
  51.  
  52. ;;; Including non-modules.
  53.  
  54. (include)
  55.  
  56. (include 0)
  57.  
  58. ;;; Warn about basic syntax of property add.
  59.  
  60. (add)
  61. (add u1)
  62. (add u1 4)
  63.  
  64. ;;; Warn about non-matching lists.
  65.  
  66. (add u* speed (0 100))
  67.  
  68. ;;; Warn about trying to fill an empty list.
  69.  
  70. (define xxx nil)
  71.  
  72. (add xxx speed nil)
  73.  
  74. ;;; Warn about incorrect table fill-in.
  75.  
  76. (table acp-to-research
  77.   (u* (u1 u2) (1 2 3 4 5 6))
  78.   )
  79.  
  80. (table acp-to-toolup
  81.   (u* (u1 u2) ((1 2) (3 4) (5 6)))
  82.   )
  83.  
  84. (table acp-to-create ("string" 56 89))
  85.  
  86. (table acp-to-create (-3 56 89))
  87.  
  88. (table acp-to-create (u1 -3 89))
  89.  
  90. (table acp-to-create (u1 u2 "foo"))
  91.  
  92. ;;; Warn about setting a non-symbol.
  93.  
  94. (set 0 2)
  95.  
  96. ;;; Warn about overwriting an existing definition.
  97.  
  98. (define u1 u2)
  99.  
  100. (set synthesis-methods nil)
  101.  
  102. (area 10 5 (terrain
  103.   "10a"
  104.   "10b"
  105.   "4a2c4b"
  106.   "10b"
  107.   "10a"
  108. ))
  109.  
  110.